<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
	  			xmlns:h="http://java.sun.com/jsf/html"
	  			xmlns:f="http://java.sun.com/jsf/core"                
                xmlns:cs="http://myfaces.apress.com/custom"
				template="/WEB-INF/layouts/standard.xhtml"
				xmlns:a4j="http://richfaces.org/a4j"
				xmlns:rich="http://richfaces.org/rich"
				xmlns:bf="http://www.bssmanager.com/jsf"
				xmlns:c="http://java.sun.com/jstl/core"
				xmlns:fn="http://www.bss.com/functions">

	<ui:define name="headIncludes">
		<style>
			.modalPanelInternal {
				width:100%;
				height:300px;
				overflow:auto;
				margin: 0px;
				padding: 0px;
			}
			.rc11 {
				border:0px;
			}
			
			.rc12 {
				color: white;
			}
			
			.rc13 {
				width:90px; 
				height: 30px; 
				border:0px;
			}
			td {
				vertical-align: top;
			}
			.rc14 {
				width: 180px;
			}			
			
			.cls12 {
				width:50%;
				height:100%;
				vertical-align: top;				
			}
													
			.rc {
				margin:0px;
				border:0px;
			}			
			.cc {
				width:40px; 
				height: 25px; 
				border:0px;
				font-size: 8pt;
			}
			
			.ccInner {
				width:40px;
				height: 100%;
			}
			.btnImgStyle {
				width: 25px; 
				height: 25px;
			}

			.ht1 {
				color: white;
				font-weight: bold;
				font-size: 12pt;
				width: 20px;
				margin-right: 15px;
			}
			.link1 {
				color: white;
				font-weight: bold;
				text-decoration: none;
			}
			
		</style>

		<script type="text/javascript"><!--
			var childW = null;
	
			function launchChildW() {				
			  var url = "${request.contextPath}/webcam2/webcam.jsp";			   
			  wopts  = 'width=350,height=300,resizable=1,alwaysRaised=1,scrollbars=1,modal=yes';	
			  if (window.showModalDialog) {
					window.showModalDialog(url,self,wopts);
				} else {
					window.open(url,'Popup',wopts);
				}
			}
					
			function setImage(im) {
				loadClickedImage();							            
			}	
			
		--></script>
		
	</ui:define>
	
	<ui:define name="formheader">
		<h2>Check In</h2>
	</ui:define>
		
	<ui:define name="content">
	
	<h:form prependId="false">
				
	<div align="left">	
			<bf:patientSelector controller="#{admissionController}" selectMethod="select" reRender="selectedPatients1,selectAttendentWindow"
				notFoundMessage="Patient not found OR Already checked-in" oncomplete="resetImage();"/>					
	</div>
	
	<table width="100%">
			<tr>
				<td valign="top" align="right">					
					<a4j:commandButton 	action="#{admissionController.validate}" 
										value="Submit"	
										limitToList="true"	
										onclick="showLoading();"								
										reRender="showErrorsWindow,confirmAdmissionWindow" 
										oncomplete="hideLoading();if(#{admissionController.error}) Richfaces.showModalPanel('showErrorsWindow'); else { Richfaces.showModalPanel('confirmAdmissionWindow'); }"/>
					<h:outputText value=" "/>								
					<a4j:commandButton 	action="#{admissionController.cancel}"
										value="Clear" 
										limitToList="true"	
										onclick="showLoading();"
										oncomplete="hideLoading();"
										reRender="dateSel,roomSelectionWindow,dormitorySelectionPanel,showErrorsWindow,submitStatusWindow,selectAttendentWindow,confirmAdmissionWindow,selectedPatients1,selectedPatients2,selectedPatients3,selectedPatientsX"/>									
					</td>
			</tr>	
	</table>
	
	<h:panelGroup style="border:0px; width:100%;" id="selectedPatients1">

			
			<bf:patient model="#{admissionController.model.patient}"
										showAddUpdateCancel="false" 
										controller="#{admissionController}"
										countryChangeAction="selectCountry"
										countrySuggestions="#{countryDao.all}"
										stateChangeAction="selectState"
										stateSuggestions="#{fn:call(stateDao,'findForCountry',admissionController.model.patient.country)}"										
										placeSuggestions="#{fn:call(placeDao,'findForState',admissionController.model.patient.state)}"
										editing="false"
										showData="false"
										loadClickedImageFunction="loadClickedImage"
										/>
			
		
		
			<h:panelGrid columns="2" width="100%" columnClasses="cls12" >
				<rich:panel style="border:0">
					<f:facet name="header">
						<h:outputText value="Medical Details"/>
					</f:facet>
							<h:panelGrid columns="2" columnClasses="cls12">
								<h:panelGroup>	
									<h:outputLabel value="Medical Problem"/>
									<h:outputLabel value="*" styleClass="requiredAtr" />
									<h:outputLabel value=":" />
								</h:panelGroup>	
								<rich:comboBox  value="#{admissionController.model.medicalProblem}"
												suggestionValues="#{medicalProblemDao.all}"
												converter="#{medicalProblemConverter}"
												enableManualInput="true"/>
								<h:panelGroup>	
									<h:outputLabel value="Case Number"/>
									<h:outputLabel value="*" styleClass="requiredAtr" />
									<h:outputLabel value=":" />
								</h:panelGroup>								
								<h:inputText size="5" value="#{admissionController.model.caseNo}"/>							
							</h:panelGrid>
				</rich:panel>
				<rich:panel style="border:0">
					<f:facet name="header">
						<h:outputText value="Stay Details"/>
					</f:facet>
							<h:panelGrid columns="2">								
								<h:outputLabel value="Stay upto: "/>
								<rich:calendar inputSize="10" id="calStay" oninputblur="if(!validateDate($('calStayInputDate').value)){alert('Entered date '+$('calStayInputDate').value+' is not valid !\nChanging to current date !');$('calStayInputDate').value='#{utils.today}'}" 
									enableManualInput="true" value="#{admissionController.model.dateTo}" datePattern="dd/MM/yyyy" />
							</h:panelGrid>
				</rich:panel>			
			</h:panelGrid>			
	</h:panelGroup>
	
	<h:panelGroup style="border:0px; width:100%;" id="selectedPatients3">		
		<h:panelGrid columns="2" cellspacing="0" cellpadding="0">
			<rich:panel style="vertical-align: top;border:0">
				<f:facet name="header">
					<h:outputText value="Material Set"/>
				</f:facet>
				<rich:dataGrid value="#{admissionController.materialAllocations}" var="materialAllocation" columns="2" style="border:0px" rowClasses="rc11" columnClasses="rc11">
					<h:panelGrid columns="2" columnClasses="rc14">
						<h:outputLabel value="#{materialAllocation.materialType.name}"/>
						<h:inputText size="1" value="#{materialAllocation.instances}" style="margin-right: 5px;" onkeyup="validateInteger(this,true,'Only numbers allowed !');" />
					</h:panelGrid>
				</rich:dataGrid>
			</rich:panel>
			<rich:panel style="border:0">
				<f:facet name="header">
					<h:outputText value="Utensil Set"/>
				</f:facet>
				<h:panelGrid columns="3" width="100%" >							
						<h:outputLabel value="Utensils Set:"/>
						<rich:comboBox  value="#{admissionController.model.materialSet}"
										suggestionValues="#{admissionController.materialSetList}"
										converter="#{materialSetConverter}"
										enableManualInput="true" 
										width="100">
										<a4j:support action="#{admissionController.updateUtensilDeposit}" event="onchange" reRender="utensilSetPanel,utensilDepositAmount" limitToList="true" ajaxSingle="true"														
														status="uscost"/>
						</rich:comboBox>
						<a4j:status forceId="true" id="uscost" >
							 <f:facet name="start">
				                  <h:graphicImage value="/images/im1.gif"/>
				             </f:facet>
						</a4j:status>
						<h:outputLabel value="Utensil Deposit: "/>
						<h:inputText id="utensilDepositAmount" value="#{admissionController.utensilDeposit}"/>								
				</h:panelGrid>
				<h:panelGroup id="utensilSetPanel">
					<h:outputText value="Items: " />												
					<rich:dataGrid value="#{admissionController.model.materialSet.materialSetMappings}" var="materialSetMapping" columns="2" style="border:0px" rowClasses="rc11" columnClasses="rc11">
						<h:panelGrid columns="2">
							<h:outputLabel value="#{materialSetMapping.materialType.name}"/>
							<h:outputText value="(#{materialSetMapping.instances})" style="margin-right: 10px;"/>
						</h:panelGrid>
					</rich:dataGrid>							
				</h:panelGroup>					
			</rich:panel>			
		</h:panelGrid>
	
	</h:panelGroup>	
	
	<rich:panel style="border:0" id="selectedPatientsX">
		<f:facet name="header">
			<h:outputText value="Attendents"/>
		</f:facet>
		<a4j:commandLink value="Select existing attendents..." onclick="Richfaces.showModalPanel('selectAttendentWindow'); return false;"/>
				<h:panelGroup id="attendentsPanel">
					<bf:attendent model="#{admissionController.currentAttendent}"
						addMethod="addAttendent"
						removeMethod="deleteAttendent"
						selectMethod="selectAttendent"
						existing="attendents"
						data="#{admissionController.currentAttendentsData}"			
						controller="#{admissionController}"
						reRender="selectAttendentWindow,attendentErrorsWindow"						
						onAddComplete="if(#{admissionController.error})Richfaces.showModalPanel('attendentErrorsWindow');"/>				
				</h:panelGroup>	
	</rich:panel>
	
	<rich:panel style="width:100%; border:0" id="selectedPatients2">
		<f:facet name="header">
			<h:outputText value="Accomodation"/>
		</f:facet>
		<h:panelGrid columns="3">	
			<rich:panel style="border:0px;">																
				<h:outputLabel value="Rooms: "/>
				<a4j:commandLink value="Select Rooms" ajaxSingle="true" limitToList="true" onclick="showLoading();" reRender="roomSelectionWindow" oncomplete="hideLoading();Richfaces.showModalPanel('roomSelectionWindow');"/>			
				<rich:dataList id="selectedRooms" value="#{fn:call(admissionController,'getSelectedRooms',admissionController.buildings)}" var="room" >
					<h:outputText value="#{room.roomNumber} ( #{room.building.name} )"/>
				</rich:dataList>						
			</rich:panel>
			<rich:panel style="border:0px;">
				<h:outputLabel value="Dormitory Beds: "/> 
				<a4j:commandLink value="Select Beds" ajaxSingle="true" limitToList="true" onclick="showLoading();" reRender="dormitorySelectionWindow" oncomplete="hideLoading();Richfaces.showModalPanel('dormitorySelectionWindow');"/>								
				<rich:dataList id="selectedDormitories" value="#{fn:call(admissionController,'getSelectedBeds',admissionController.buildings)}" var="bed" >
					<h:outputText value="#{bed.bedNumber} ( #{bed.room.building.name} - #{bed.room.roomNumber} )"/>
				</rich:dataList>																										
			</rich:panel>
			<rich:panel style="border:0px;">
			<h:outputLabel value="Security Deposit: "/>
			<h:inputText id="securityDeposit" value="#{admissionController.securityDeposit}" size="5"/>	
			</rich:panel>
		</h:panelGrid>
					
	</rich:panel>	
</h:form>	
		
							
	<rich:modalPanel id="roomSelectionWindow" minWidth="300" zindex="2000" width="680" height="500" >
			<f:facet name="header">
				<h:outputText value="Rooms"/>
			</f:facet>
			<f:facet name="controls">
            	<h:graphicImage value="/images/close.gif" 
            					style="cursor:pointer" 
            					onclick="Richfaces.hideModalPanel('roomSelectionWindow')" />
      		</f:facet>	      		      					
			<h:form>
				<table>
    			<tr>
    				<td>								
						<div style="overflow: scroll; height: 480px">
								
							<ui:repeat var="building" value="#{admissionController.buildings}" >
							<h:outputLabel value="Building #{building.name}"/>
							<hr/>
							<ui:repeat var="floor" value="#{arrayCreator[building.floors]}" >				
								<h:outputLabel value="Floor #{floor}"/>		
									<rich:dataGrid value="#{fn:call(admissionController,'findRooms',fn:concat(fn:concat(fn:concat(fn:concat('building.id=',building.id),',floor='),floor),',dormitory=false'))}" 
									var="room"  columns="10" rowClasses="rc" columnClasses="cc" style="border:0px" >
										<h:panelGrid style="background-color: #{room.occupied ? 'gray':'green'};" styleClass="ccInner"  columns="2" >
											<h:selectBooleanCheckbox rendered="#{not room.occupied}"  value="#{room.selected}"/>								
											<h:outputLabel value="#{room.roomNumber}" styleClass="rc12"/>										
										</h:panelGrid>								
									</rich:dataGrid>			
								</ui:repeat>
							</ui:repeat>	
						</div>
					</td>
					<td>	
						<a4j:commandButton value="Done" onclick="showLoading();" action="#{admissionController.selectRooms}" limitToList="true" reRender="selectedRooms" oncomplete="hideLoading();Richfaces.hideModalPanel('roomSelectionWindow');"/>
						<br/>
						<br/>										
						<a4j:commandButton value="Cancel" onclick="Richfaces.hideModalPanel('roomSelectionWindow');return false;"/>
					</td>
				</tr>
			</table>
		</h:form>
	</rich:modalPanel>
	
	<rich:modalPanel id="dormitorySelectionWindow"  minWidth="300" zindex="2000" width="680" height="500" >
		<f:facet name="header">
			<h:outputText value="Dormitories"></h:outputText>
		</f:facet>
		<f:facet name="controls">
       		<h:graphicImage value="/images/close.gif" 
       					style="cursor:pointer" 
       					onclick="Richfaces.hideModalPanel('dormitorySelectionWindow')" />
 			</f:facet> 			
    	<h:form> 	    	
    		<table>
    			<tr>
    				<td>		
									
						<div style="overflow: scroll; height: 480px">
							<h:panelGroup id="dormitorySelectionPanel">
								<ui:repeat var="building" value="#{admissionController.buildings}" >
									<h5>Building #{building.name}</h5>
									<hr/>
									<ui:repeat var="floor" value="#{arrayCreator[building.floors]}" >				
										<h6>Floor #{floor}</h6>	
										<ui:repeat var="dormitory" value="#{fn:call(admissionController,'findDormitories',fn:concat(fn:concat(fn:concat(fn:concat('building.id=',building.id),',floor='),floor),',dormitory=true'))}" >
											<h6>Dormitory-${dormitory.roomNumber}</h6>
											<rich:dataGrid value="#{fn:asList(dormitory.beds)}" var="bed" columns="10" style="border:0px" rowClasses="rc" columnClasses="cc">
												<h:panelGrid style="background-color: #{bed.occupied ? 'gray':'green'};" styleClass="ccInner" columns="2" >
													<h:selectBooleanCheckbox rendered="#{not bed.occupied}" value="#{bed.selected}"/>
													<h:outputLabel value="#{bed.bedNumber}" styleClass="rc12"/>									
												</h:panelGrid>										
											</rich:dataGrid>							
										</ui:repeat>
									</ui:repeat>
								</ui:repeat>	
							</h:panelGroup>
						</div>
					</td>
					<td>					
						<a4j:commandButton value="Done" action="#{admissionController.selectBeds}" onclick="showLoading();" limitToList="true"
											reRender="selectedDormitories" oncomplete="hideLoading();Richfaces.hideModalPanel('dormitorySelectionWindow');"/>
						<br/>
						<br/>
						<a4j:commandButton value="Cancel" onclick="Richfaces.hideModalPanel('dormitorySelectionWindow');return false;"/>
					</td>
				</tr>
			</table>
		</h:form>
		
	</rich:modalPanel>
	
	<rich:modalPanel id="showErrorsWindow" width="450" zindex="2000" resizeable="false" autosized="true" >
			<f:facet name="header">
				<h:outputText value="Checkin Errors"/>
			</f:facet>	
			<f:facet name="controls">
       			<h:graphicImage value="/images/close.gif" 
       					style="cursor:pointer" 
       					onclick="Richfaces.hideModalPanel('showErrorsWindow')" />
 			</f:facet>	
			<h:form>
				<h:messages errorClass="errors" style="color:#ff1111" />
				<h:panelGrid>
					<h:outputText value="Please correct above errors..." style="background-color: orange; font-weight:bold"/>
					<h:commandButton value="OK" onclick="Richfaces.hideModalPanel('showErrorsWindow'); return false;"/>
				</h:panelGrid>
			</h:form>
	</rich:modalPanel>
	
	<rich:modalPanel id="attendentErrorsWindow" minWidth="300" zindex="2000" resizeable="false" autosized="true" >
			<f:facet name="header">
				<h:outputText value="Attendant Error"/>
			</f:facet>		
			<h:form>
				<h:messages errorClass="errors" style="color:#ff1111" />
				<h:outputText value="#{admissionController.error ? (not empty admissionController.errors? admissionController.errors[0]:''):''}"/>
				<h:panelGrid>
					<h:outputText value="Please correct above errors..." style="background-color: orange; font-weight:bold"/>
					<h:commandButton value="OK" onclick="Richfaces.hideModalPanel('attendentErrorsWindow'); return false;"/>
				</h:panelGrid>
			</h:form>
	</rich:modalPanel>	
	
	<rich:modalPanel id="submitStatusWindow" width="450" zindex="2000" resizeable="false" autosized="true" >
			<f:facet name="header">
				<h:outputText value="Submit Status"/>
			</f:facet>		
			<h:form>
				<table width="100%" align="left">
					<tr>
						<td valign="top">
							<div style="height:200px; overflow: auto;">
								The patient was added successfully !
								<ul>
									<li>
										<a href="#" onclick="showLoading();document.location.href='generateId.jsf?id=#{admissionController.admissionId}'">Proceed to ID Generation</a>
									</li>
									<li>
										WARNING: Please do not press Back or Refresh button of the browser!!! 
									</li>
								</ul>
							</div>
						</td>						
					</tr>
					<tr>
						<td>							
							<div>			
								<h:commandButton rendered="false" value="Close to Activate Later" onclick="Richfaces.hideModalPanel('submitStatusWindow'); return false;"/>
							</div>
						</td>
					</tr>
				</table>
			</h:form>
	</rich:modalPanel>		
		
	<rich:modalPanel id="selectAttendentWindow"  zindex="2000" resizeable="false" autosized="true" minWidth="300">
			<f:facet name="header">
				<h:outputText value="Attendents"/>
			</f:facet>		
			<f:facet name="controls">
       			<h:graphicImage value="/images/close.gif" 
       					style="cursor:pointer" 
       					onclick="Richfaces.hideModalPanel('selectAttendentWindow')" />
 			</f:facet>
			<h:form prependId="false">
				<h:outputText rendered="#{empty admissionController.attendents or admissionController.attendents.rowCount le 0}" value="No attendents found " />
				<h:panelGrid columns="2">
							<rich:dataTable rendered="#{not empty admissionController.attendents and admissionController.attendents.rowCount gt 0}" rows="10" value="#{admissionController.attendents}" var="aBean" align="center" style="text-align:left">
								<rich:column>
									<h:selectBooleanCheckbox value="#{aBean.selected}" disabled="#{aBean.selected}" /><h:outputText value="#{aBean.name} "/>
								</rich:column>																	
								<f:facet name="footer">
									<h:outputText value="(#{admissionController.attendents.rowCount }) attendents found " />
									<rich:datascroller  align="center"/>
								</f:facet>
							</rich:dataTable>
						
							<h:panelGrid columns="1">
								<a4j:commandButton rendered="#{admissionController.attendents.rowCount gt 0}" reRender="attendentsPanel,selectAttendentWindow" limitToList="true" onclick="showLoading();" action="#{admissionController.selectAttendents}" oncomplete="hideLoading();Richfaces.hideModalPanel('selectAttendentWindow');" value="Add" />
								<a4j:commandButton id="closeSA" onclick="Richfaces.hideModalPanel('selectAttendentWindow'); return false;" value="Close"/>
							</h:panelGrid>						
				</h:panelGrid>
			</h:form>			
	</rich:modalPanel>	

	<rich:modalPanel id="confirmAdmissionWindow" width="800" zindex="2000" autosized="true" >
			<f:facet name="header">
				<h:outputText value="Checkin Confirmation"/>
			</f:facet>		
			<h:form>
			<h:panelGrid columns="3">
										<h:panelGroup >											
												<h:graphicImage rendered="#{model.id gt 0 or editing}" url="/bss/images/saved?id=#{model.id}"/>
												<h:graphicImage rendered="#{not empty imageController.patientService.imageData}" url="/bss/images/clicked2"/>										
										</h:panelGroup>
										<h:panelGrid columns="2">			
											<h:outputLabel value="First Name:" />
											<h:outputText value="#{admissionController.model.patient.firstName}"/>
											<h:outputLabel value="Middle Name:" />
											<h:outputText value="#{admissionController.model.patient.middleName}"/>
											<h:outputLabel value="Last Name:" />
											<h:outputText value="#{admissionController.model.patient.lastName}"/>
											<h:outputLabel value="Address:" />
											<h:outputText value="#{admissionController.model.patient.addressLine1}"/>
											<h:outputLabel value="DateOfBirth:" />
											<h:outputText value="#{admissionController.model.patient.dateOfBirth}"/>
											<h:outputLabel value="Sex:" />
											<h:outputText value="#{admissionController.model.patient.sex == 'M' ? 'Male' : 'Female'}"/>							
											<h:outputLabel value="ID Card Type:"/>
											<h:outputText value="#{admissionController.model.patient.idCardType}" converter="#{idCardTypeConverter}" />
											<h:outputLabel value="ID Card Number:" />
											<h:outputText value="#{admissionController.model.patient.idCardNumber}"/>
											<h:outputLabel value="Phone Number:" />
											<h:outputText value="#{admissionController.model.patient.phone}"/>
											<h:outputLabel value="Profession" />
											<h:outputText value="#{admissionController.model.patient.profession}" converter="#{professionConverter}"/>
											<h:outputLabel value="Medical Problem"/>
											<h:outputText  value="#{admissionController.model.medicalProblem}" converter="#{medicalProblemConverter}"/>
											<h:outputLabel value="Case Number:" style="color:red"/>
											<h:outputText value="#{admissionController.model.caseNo}" />																		
											<h:outputLabel value="Stay to: "/>
											<h:outputText value="#{admissionController.model.dateTo}">
												<f:convertDateTime pattern="dd MMM yy HH:mm" timeZone="#{preferences.timeZone.ID}"/>
											</h:outputText>							
										</h:panelGrid>
										
										
										<h:panelGroup>
											<h:panelGrid >
											<h:outputText value="Are you sure to submit ?" style="color: red; font-weight:bold"/>
											<a4j:commandButton 	action="#{admissionController.add}"
															value="Submit" 
															reRender="submitStatusWindow"
															limitToList="true"
															onclick="showLoading();"									
															oncomplete="hideLoading();Richfaces.hideModalPanel('confirmAdmissionWindow');if(! #{admissionController.error}) Richfaces.showModalPanel('submitStatusWindow'); else alert('Error while adding: #{admissionController.errors[0]} \nPlease check the data and retry !');"/>
														<a4j:status id="valsub123" forceId="true">
															 <f:facet name="start">
												                  <h:graphicImage value="/images/im1.gif"/>
												             </f:facet>
														</a4j:status>
											<h:commandButton value="Cancel" onclick="Richfaces.hideModalPanel('confirmAdmissionWindow'); return false;"/>
											</h:panelGrid>
										</h:panelGroup>
										
											<h:panelGrid columns="1">			
												<h:panelGroup>				
													<h:outputLabel value="Rooms: " style="color:red"/>	
													<rich:dataList value="#{fn:call(admissionController,'getSelectedRooms',admissionController.buildings)}" var="room" >
														<h:outputText value="#{room.roomNumber} ( #{room.building.name} )"/>
													</rich:dataList>
												</h:panelGroup>
												<h:panelGroup>
													<h:outputLabel value="Dormitory Beds: " style="color:red"/>
													<rich:dataList value="#{fn:call(admissionController,'getSelectedBeds',admissionController.buildings)}" var="bed" >
														<h:outputText value="#{bed.bedNumber} ( #{bed.room.building.name} - #{bed.room.roomNumber} )"/>
													</rich:dataList>
												</h:panelGroup>
											</h:panelGrid>																											
											<rich:dataTable value="#{admissionController.currentAttendentsData}" var="aBean" align="center" style="text-align:left">
												<f:facet name="header">
													<h:outputText value="Attendents"/>
												</f:facet>									
												<rich:column>
													<f:facet name="header">Name</f:facet>
													<h:outputText value="#{aBean.attendent.name} "/>
												</rich:column>																	
												<f:facet name="footer">
													<h:outputText rendered="#{empty admissionController.currentAttendentsData or admissionController.currentAttendentsData.rowCount le 0}" value="No Attendents..." />
													<h:outputText rendered="#{not empty admissionController.currentAttendentsData or admissionController.currentAttendentsData.rowCount gt 0}" value="#{admissionController.currentAttendentsData.rowCount} Attendents..." />
												</f:facet>
											</rich:dataTable>
											<rich:panel>
												<f:facet name="header">
													<h:outputText value="Deposits"/>												
												</f:facet>
												<h:panelGrid columns="2">
													<h:outputLabel value="Security: "/>
													<h:outputText id="securityDeposit" value="#{admissionController.securityDeposit}"/>	
													<h:outputLabel value="Utensil: "/>
													<h:outputText id="utensilDepositAmount" value="#{admissionController.utensilDeposit}"/>			
												</h:panelGrid>	
											</rich:panel>
										
			
			</h:panelGrid>
			
			
			
			
										<h:panelGrid columns="2">
											<f:facet name="header">
												<h:outputLabel value="Material and Utensil Set"/>												
											</f:facet>											
											<rich:dataGrid value="#{admissionController.materialAllocations}" var="materialAllocation" columns="4" style="border:0px" rowClasses="rc11" columnClasses="rc11">
													<h:outputText style="width: 100px;" value="#{materialAllocation.materialType.name} #{materialAllocation.instances}"/>
											</rich:dataGrid>
											<h:panelGroup>
												<h:outputLabel value="Utensils Set:" style="color:red"/>
												<h:outputText value="#{admissionController.model.materialSet}" converter="#{materialSetConverter}"/>
											</h:panelGroup>
										</h:panelGrid>				
		
			</h:form>
	</rich:modalPanel>
	
	
	
	</ui:define>
</ui:composition>